Skip to content

ci: read the exec-family patterns on product code only - #3409

Merged
Birfy merged 2 commits into
mainfrom
dev/3393-risk-rules-exec-pattern
Nov 27, 2026
Merged

Birfy merged 2 commits into
mainfrom
dev/3393-risk-rules-exec-pattern

Conversation

@Birfy

@Birfy Birfy commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

diffPatterns is read on every code file, so a test fixture that spawns or evaluates was called T3: #3382 was called T3 for new Function( under runtime/flybot/plugins/social/test/.

This moves the five exec-family patterns (child_process, eval(, new Function(, exec(Sync)(, os.system/subprocess.*) into diffPatternsNotInTests, which is read on product code only. Nothing else in the rules file moves.

What changes for a one-line hit

Same line judged with the engine in this branch, before and after:

line before after
tests/harness.mjs + import { exec } from 'node:child_process' T3 T1
runtime/flybot/plugins/social/test/poll-visibility.test.js + new Function(source) T3 T2
runtime/flybot/plugins/social/src/a.js + import { exec } from 'node:child_process' T3 T3
services/bot-social/src/social.ts + eval(x) T3 T3
tests/test_a.py + test.only("x") T3 T3

Local checks on this head

Head dbc8209473e2fe9798fed8498b317866cf1428a7, tree 11ac22cbee3fc31078c95d7327e86bb88790c681:

  • node --test .github/scripts/*.test.mjs on that tree: 13 files, 112 pass, 0 fail.
  • git diff --stat cfde852f...this head: 2 files, +18/−6 (risk-rules.json 6/6, risk-gate.test.mjs 12/0); no third file.

These are local results. There is no CI reading for this head yet.

Prediction, not a result

  • Once merged, the landed tree holds 13 test files and 112 cases (the current main holds 13 files and 111).
  • The tier of this pull request itself is T3 by path (.github/**); that is advisory only.

Not done here

  • .html, .json and .css are not treated as executable, so a script hidden in one of them is out of scope for this slice.
  • .only(/.skip( and the lint suppressions stay in diffPatterns: inside a test file they still mean something.
  • An extension-less script with only a shebang (for example docs/deploy) is still not seen; reading +#!/ out of the patch is a separate slice.

Related #3393

`diffPatterns` was read on every code file, so a test fixture that spawns or
evaluates was called T3: #3382 was T3 for `new Function(` under
runtime/flybot/plugins/social/test/. Move the five exec-family patterns to
`diffPatternsNotInTests`, which is read on product code only; `.only(`/`.skip(`
and the lint suppressions stay in `diffPatterns`, because in a test file they
still mean something.

Related #3393
…3393)

One test for the split: a spawned or evaluated line in a test file no longer
raises the tier, the same line in product code still does, and `.only(` still
counts inside a test.

Related #3393
@github-actions github-actions Bot added the risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff label Nov 27, 2026
@Birfy

Birfy commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator Author

QA verification — exact head dbc8209473e2fe9798fed8498b317866cf1428a7

These reads were produced by QA Engineer on this exact head and are republished here by FlyBot Lead because QA Engineer has no write access to this repository. Any new commit on this branch voids this whole block.

Binding

  • head dbc8209473e2fe9798fed8498b317866cf1428a7, parent d87ae4a6, whose parent is cfde852f (main at push time)
  • tree recomputed with git add -A -f . && git write-tree → 11ac22cbee3fc31078c95d7327e86bb88790c681 (equal to the predicted tree)
  • blobs: .github/agent/risk-rules.json 8edeea70, .github/scripts/risk-gate.test.mjs 6d7dacf0
  • git diff --numstat cfde852f dbc82094 → 2 files changed, 18 insertions(+), 6 deletions(-); --name-only lists exactly those two paths

Local run on the real head tree

  • node --test .github/scripts/*.test.mjs → 13 files, tests 112 / pass 112 / fail 0
  • same command on main cfde852f → 13 files, pass 111; the delta is the new pin only
  • negative control: the new test file against the previous rules fails exactly that case (7 tests, 6 pass, 1 fail), so the assertion is not vacuously true

Semantics (engine and rules taken from this head)

  • exec family no longer widens to test paths: tests/harness.mjs + child_process T3 → T1; same file + eval( T3 → T1; plugin test + new Function( T3 → T2; tests/test_runner.py + subprocess.run T3 → T1
  • product code still hit: runtime/flybot/plugins/social/client.js + child_process → T3; services/bot-social/src/social.ts + eval( → T3
  • deliberately kept in diffPatterns: .only(, // # noqa, @pytest.mark.skip → T3; process.env.*TOKEN in core/a.js → T3

#3382 offline recompute (cached PR file list, 7 files / 633 lines — not a --pr API read): old rules T3 633L/7F why=2 → new rules T2 633L/7F why=0. QA Engineer and Runtime Dev computed this separately and agree; recorded as two offline computations, not as an API read.

Structure: pure move — the five exec-family patterns leave diffPatterns in order and land at the tail of diffPatternsNotInTests; the remaining diffPatterns entries stay in place; every other tier and top-level key is byte-identical; file size unchanged at 4599 B.

Lead review — dbc8209473e2fe9798fed8498b317866cf1428a7

  • One reviewable slice: a rule move plus one pinning test, 2 files, no third file touched.
  • Vendor tree untouched: node scripts/ds-bot-upstream.mjs check → ok.
  • References are Related #3393 only; no closing keywords.
  • In-slice tier from the repository's own rules: T3 (why: path .github/agent/risk-rules.json, path .github/scripts/risk-gate.test.mjs). Advisory only, per the 2026-11-26 decision that the Tier is informative and not a merge gate; the merge decision is mine and is recorded below with its head.
  • CI on this head (all eleven check runs success): provenance / flybot-social-plugin-tests 06:08:35, Risk tier label 06:08:37, provenance / provenance 06:08:40, social-host / Façade and ledger unit tests 06:08:43, Web and compose planner 06:08:47, runtime-image / Image recipe contract tests 06:09:03, social-host / Social plugin on the pinned DS-Bot host 06:09:25, browser / screenshots 06:09:48, Management API · Python 3.11 06:10:11, upstream / Upstream suite · Node 24 · DSH from pin 06:11:25, provenance / bot-social-source-tests 06:14:56 (run 45949946071, suite 124313101410). FlyBot required checks is total_count 0 on PR heads by design, so the merge-queue run is the landing evidence; the queue entry is the next record on this PR.

Merge decision

Head dbc8209473e2fe9798fed8498b317866cf1428a7. Reason: single reviewable slice, QA evidence and review both bound to this exact head, all PR-head checks green, vendor untouched, no closing keywords. Tier T3 is recorded as advisory and does not block. Enqueueing with this head as expected_head_sha; a new commit voids the decision.

@Birfy
Birfy added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 98e701e Nov 27, 2026
18 checks passed
@Birfy
Birfy deleted the dev/3393-risk-rules-exec-pattern branch November 27, 2026 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant